Optimal. Leaf size=97 \[ -\frac {15 a^4 \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {15 i a^4 \sec (c+d x)}{2 d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^3}{d}-\frac {5 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3577, 3579,
3567, 3855} \begin {gather*} -\frac {15 i a^4 \sec (c+d x)}{2 d}-\frac {15 a^4 \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {5 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{2 d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^3}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3567
Rule 3577
Rule 3579
Rule 3855
Rubi steps
\begin {align*} \int \cos (c+d x) (a+i a \tan (c+d x))^4 \, dx &=-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^3}{d}-\left (5 a^2\right ) \int \sec (c+d x) (a+i a \tan (c+d x))^2 \, dx\\ &=-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^3}{d}-\frac {5 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{2 d}-\frac {1}{2} \left (15 a^3\right ) \int \sec (c+d x) (a+i a \tan (c+d x)) \, dx\\ &=-\frac {15 i a^4 \sec (c+d x)}{2 d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^3}{d}-\frac {5 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{2 d}-\frac {1}{2} \left (15 a^4\right ) \int \sec (c+d x) \, dx\\ &=-\frac {15 a^4 \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {15 i a^4 \sec (c+d x)}{2 d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^3}{d}-\frac {5 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(906\) vs. \(2(97)=194\).
time = 6.27, size = 906, normalized size = 9.34 \begin {gather*} \frac {15 \cos (4 c) \cos ^4(c+d x) \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right ) (a+i a \tan (c+d x))^4}{2 d (\cos (d x)+i \sin (d x))^4}-\frac {15 \cos (4 c) \cos ^4(c+d x) \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right ) (a+i a \tan (c+d x))^4}{2 d (\cos (d x)+i \sin (d x))^4}+\frac {\cos (d x) \cos ^4(c+d x) (-8 i \cos (3 c)-8 \sin (3 c)) (a+i a \tan (c+d x))^4}{d (\cos (d x)+i \sin (d x))^4}+\frac {\cos ^4(c+d x) \sec (c) (-4 i \cos (4 c)-4 \sin (4 c)) (a+i a \tan (c+d x))^4}{d (\cos (d x)+i \sin (d x))^4}-\frac {15 i \cos ^4(c+d x) \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right ) \sin (4 c) (a+i a \tan (c+d x))^4}{2 d (\cos (d x)+i \sin (d x))^4}+\frac {15 i \cos ^4(c+d x) \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right ) \sin (4 c) (a+i a \tan (c+d x))^4}{2 d (\cos (d x)+i \sin (d x))^4}+\frac {\cos ^4(c+d x) (8 \cos (3 c)-8 i \sin (3 c)) \sin (d x) (a+i a \tan (c+d x))^4}{d (\cos (d x)+i \sin (d x))^4}+\frac {\cos ^4(c+d x) \left (\frac {1}{4} \cos (4 c)-\frac {1}{4} i \sin (4 c)\right ) (a+i a \tan (c+d x))^4}{d (\cos (d x)+i \sin (d x))^4 \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )^2}-\frac {i \cos ^4(c+d x) (4 \cos (4 c)-4 i \sin (4 c)) \sin \left (\frac {d x}{2}\right ) (a+i a \tan (c+d x))^4}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) (\cos (d x)+i \sin (d x))^4 \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}+\frac {\cos ^4(c+d x) \left (-\frac {1}{4} \cos (4 c)+\frac {1}{4} i \sin (4 c)\right ) (a+i a \tan (c+d x))^4}{d (\cos (d x)+i \sin (d x))^4 \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )^2}+\frac {i \cos ^4(c+d x) (4 \cos (4 c)-4 i \sin (4 c)) \sin \left (\frac {d x}{2}\right ) (a+i a \tan (c+d x))^4}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) (\cos (d x)+i \sin (d x))^4 \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 154, normalized size = 1.59
method | result | size |
risch | \(-\frac {8 i a^{4} {\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {i a^{4} \left (9 \,{\mathrm e}^{3 i \left (d x +c \right )}+7 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {15 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}+\frac {15 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}\) | \(107\) |
derivativedivides | \(\frac {a^{4} \left (\frac {\sin ^{5}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-4 i a^{4} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )-6 a^{4} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-4 i a^{4} \cos \left (d x +c \right )+a^{4} \sin \left (d x +c \right )}{d}\) | \(154\) |
default | \(\frac {a^{4} \left (\frac {\sin ^{5}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-4 i a^{4} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )-6 a^{4} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-4 i a^{4} \cos \left (d x +c \right )+a^{4} \sin \left (d x +c \right )}{d}\) | \(154\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 137, normalized size = 1.41 \begin {gather*} -\frac {a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\sin \left (d x + c\right ) - 1\right ) - 4 \, \sin \left (d x + c\right )\right )} + 16 i \, a^{4} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} + 12 \, a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} + 16 i \, a^{4} \cos \left (d x + c\right ) - 4 \, a^{4} \sin \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 162, normalized size = 1.67 \begin {gather*} \frac {-16 i \, a^{4} e^{\left (5 i \, d x + 5 i \, c\right )} - 50 i \, a^{4} e^{\left (3 i \, d x + 3 i \, c\right )} - 30 i \, a^{4} e^{\left (i \, d x + i \, c\right )} - 15 \, {\left (a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{4}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) + 15 \, {\left (a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{4}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{2 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.26, size = 153, normalized size = 1.58 \begin {gather*} \frac {15 a^{4} \left (\frac {\log {\left (e^{i d x} - i e^{- i c} \right )}}{2} - \frac {\log {\left (e^{i d x} + i e^{- i c} \right )}}{2}\right )}{d} + \frac {- 9 i a^{4} e^{3 i c} e^{3 i d x} - 7 i a^{4} e^{i c} e^{i d x}}{d e^{4 i c} e^{4 i d x} + 2 d e^{2 i c} e^{2 i d x} + d} + \begin {cases} - \frac {8 i a^{4} e^{i c} e^{i d x}}{d} & \text {for}\: d \neq 0 \\8 a^{4} x e^{i c} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 372 vs. \(2 (81) = 162\).
time = 0.87, size = 372, normalized size = 3.84 \begin {gather*} \frac {235 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 470 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 5 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 10 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 235 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 470 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 5 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) + 10 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 256 i \, a^{4} e^{\left (5 i \, d x + 5 i \, c\right )} - 800 i \, a^{4} e^{\left (3 i \, d x + 3 i \, c\right )} - 480 i \, a^{4} e^{\left (i \, d x + i \, c\right )} + 235 \, a^{4} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 5 \, a^{4} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 235 \, a^{4} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 5 \, a^{4} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right )}{32 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.30, size = 159, normalized size = 1.64 \begin {gather*} -\frac {15\,a^4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {17\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,9{}\mathrm {i}-39\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,7{}\mathrm {i}+24\,a^4}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,1{}\mathrm {i}-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,2{}\mathrm {i}+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________